package com.example.demo.service;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

import com.example.demo.model.User;

@Service
public class UserService {
	
//	@Cacheable(value = "user_one",key="#user.age.toString()")
	@MyCacheable
	public User getUser(User user) {
		System.out.println("11111111111111111111");
		return new User("李四", 19, "长沙");
	}
	
	@CacheEvict(value="user_one",allEntries=true)
	public void updateUser() {
		System.out.println("清除了缓存");
	}
}
